<div>
  今日新增:
  <%= @today_count %>
  店铺
</div>
<div>
  本周新增:
  <%= @week_count %>
  店铺
</div>
<div>
  总共:
  <%= @total_count %>
  店铺
</div>
<div>
  <%= link_to "新建用户", "/information_clerk/new" %>
</div>
<div>
  <table border="0" cellpadding="3" cellspacing="1" width="100%" align="center" style="background-color: #b9d8f3;">
    <tr>
      <td>姓名</td>
      <td>手机号码</td>
      <td>状态</td>
      <td>业绩（日/周/月）</td>
      <td>查看业绩</td>
      <td>编辑</td>
    </tr>
    <% @users.each do |user| %>
      <% today_count = get_user_count_by(user.id, beginning_of_today) %>
      <% week_count = get_user_count_by(user.id, beginning_of_week) %>
      <% month_count = get_user_count_by(user.id, beginning_of_month) %>
      <tr>
        <td><%= user.name %></td>
        <td><%= user.mobile %></td>
        <td><%= user.is_active ? "激活" : "未激活" %></td>
        <td><%= "#{today_count}/#{week_count}/#{month_count}" %></td>
        <td><%= link_to "查看业绩", "/information_clerk/#{user.id}" %></td>
        <td><%= link_to "编辑", "/information_clerk/#{user.id}/edit" %></td>
      </tr>
    <% end -%>
  </table>
  <%= paginate @users %>
</div>